package xin.yangshuai.fastjson01.controller;

import com.alibaba.fastjson.JSON;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * HelloController
 *
 * @author shuai
 * @date 2021/12/20
 */
@RestController
public class HelloController {

    @RequestMapping("hello1")
    public Object hello1() {
        String string = JSON.toJSONString("北京");

        Map<String,String> map = new HashMap<>();

        map.put(string,"hello world");

        String string1 = JSON.toJSONString(map);

        String replace = string1.replace("\\", "");


        return replace;
    }
}
